package com.sudo.service;

import com.sudo.common.utils.PagedGridResult;
import com.sudo.pojo.SysUser;
import com.sudo.pojo.bo.SimpleUserBO;
import com.sudo.pojo.bo.SysUserBasicInfoBO;
import com.sudo.pojo.bo.SysUserReBO;
import com.sudo.pojo.vo.SysSimpleUserVO;
import com.sudo.pojo.vo.SysUserReVO;

public interface SysUserService {

    SysUserReVO getSysUserAndRoleByUsername(String username);

    /**
     * 通过用户名查询用户基础信息
     *
     * @param username
     * @return
     */
    SysUser getSysUserByUsername(String username);

    /**
     * 通过注册邮箱查询用户基础信息
     *
     * @param mail
     * @return
     */
    SysUser getSysUserByMail(String mail);

    /**
     * 用过通过用户名或邮箱登录
     * @param mailOrUsername
     * @param pwd
     * @return SysUser
     */
    SysUser sysUserLoginByMailOrUsername(String mailOrUsername, String pwd);


    /**
     * 判断邮箱或用户名是否存在
     * @param mailOrUsername
     * @return
     */
    boolean queryMailOrUsernameIsExist(String mailOrUsername);

    PagedGridResult queryAllSysUserMainInfoByPage(Integer page, Integer pageSize, String usernameOrNick);

    int addUser(SimpleUserBO simpleUserBO, String sessionUser);

    int updateSysUserRoleStatus(String username, String roleCode, String status);

    int deleteSysUserByUsername(String username);

    PagedGridResult getOnlineUserByPage(Integer page,Integer pageSize);

    int updateMyUserInfo(SysUserBasicInfoBO basicInfoBO);

    SysSimpleUserVO getMySimpleUserInfo(String username);
}
